<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<style type = 'text/css'>
p {
    font-family: 'Lekton', Helvetica, Arial, sans-serif;
    font-size: 12px;
    line-height: 18px;
}
h1 {
    font-family: 'Molengo', Georgia, Times, serif;
}
</style>
<CFIF IsDefined("GetEntry")>
<cfset uid = GetEntry.PERSONNELIDNO>
<CFELSE>
<CFSET uid = CLIENT.CHAPA>
</CFIF>

<CFQUERY name="getDtls" datasource="#CLIENT.COMPANY_DSN#" MAXROWS="1">
SELECT A.FIRSTNAME, A.MIDDLENAME, A.LASTNAME, DEP.DESCRIPTION AS DEPT, POS.DESCRIPTION AS POSTN
FROM CMFPA A
LEFT JOIN CLKDEPARTMENT DEP ON DEP.DEPARTMENTCODE = A.DEPARTMENTCODE
LEFT JOIN CLKPOSITION POS ON POS.POSITIONCODE = A.POSITIONCODE
WHERE A.PERSONNELIDNO = '#uid#'
</CFQUERY>

<cfset name = "#getDtls.FIRSTNAME# #getDtls.MIDDLENAME# #getDtls.LASTNAME#">

<cfset name = "#getDtls.FIRSTNAME# #getDtls.MIDDLENAME# #getDtls.LASTNAME#">
<CFSET posn =getDtls.POSTN>
<CFSET dept =getDtls.DEPT>

<cfoutput>
<p>
	Name:&nbsp;&nbsp;#name#<br />
	Position:&nbsp;&nbsp;#posn#<br />
	Department:&nbsp;&nbsp;#dept#<br />
</p>
</cfoutput>
<title>Untitled Document</title>
<script>

$(document).ready(function() {
	
	

	$('form').submit(function() {
		
		
		var datefrom = Date.parse($('[name=edtDATEFROM]').val());
		var dateto = Date.parse($('[name=edtDATETO]').val());
		
		
		if(dateto < datefrom) {
			
				alert('"Date From" should be earlier than "Date To" field.');
				return false;
			
		} else {
			var datefrom = Date.parse($('[name=edtOFFSETDATEFR]').val() + ' ' + $('[name=edtOFFSETTIMEFR]').val() );
			var dateto = Date.parse($('[name=edtOFFSETDATETO]').val() + ' ' + $('[name=edtOFFSETTIMETO]').val() );
			
			if(dateto < datefrom) {
				
					alert('"Offsetting Date From" should be earlier than "Date To" field.');
					return false;
				
			} else if (dateto == datefrom) {
				   alert('"Date From" should be earlier than "Date To" field.');
				   return false;
		    }
			else {
					return true;
			}
		}
		
		
		
		
		
	
	})
	
});

</script>
</head>

<body>


</body>
</html>
